<form class="form-horizontal" #form="ngForm">
  <div class="form-group">
    <label class="col-sm-2 control-label">默认示例</label>
    <div class="col-sm-5">
      <input type="text" class="form-control" placeholder="只能输入汉字"
             [(ngModel)]="default" name="default" #defaultVar="ngModel"
             greatRegexp="^[\u4e00-\u9fa5]+$"
      >
    </div>
    <div class="col-sm-4">
      <span class="help-block">只能输入汉字！</span>
    </div>
  </div>
  <div class="form-group">
    <div class="col-sm-10 pull-right has-error" *ngIf="defaultVar.invalid && (defaultVar.dirty || defaultVar.touched)">
      {{defaultVar?.errors|json}}
    </div>
  </div>

  <div class="form-group">
    <label class="col-sm-2 control-label">默认示例2</label>
    <div class="col-sm-5">
      <input type="text" class="form-control" placeholder="不能输入汉字"
             [(ngModel)]="default2" name="default2" #default2Var="ngModel"
             greatRegexp="[\u4e00-\u9fa5]" inverse="true"
      >
    </div>
    <div class="col-sm-4">
      <span class="help-block">不能输入汉字！取反：inverse="true"</span>
    </div>
  </div>
  <div class="form-group">
    <div class="col-sm-10 pull-right has-error" *ngIf="default2Var.invalid && (default2Var.dirty || default2Var.touched)">
      {{default2Var?.errors|json}}
    </div>
  </div>

</form>
